//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <elasysapi.h>
#include <stdlib.h>
#include "crt0.h"
#include <aura.h>

static void __cdecl doexit(int status, int quick)
{
    if (1 == quick) {//quick cleanup
        __exeatexit((EXIT_FUNCTION)0);//Free exit func stack
    }
    else {
        __exeatexit((EXIT_FUNCTION)-1);
    }

    AuraProcess_Exit((Aura_ExitCode)status);
    /*NOTREACHED*/
}

EXTERN_C void __cdecl _exit(int status)
{
    doexit(status, 1);
}

EXTERN_C void __cdecl exit(int status)
{
    doexit(status, 0);
}
